package com.bbz.core.final_test;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

public class Test {
    public static void main(String args[]){
        StringA a=new StringA();
        System.out.println(a.getAa());
        try {

            Class clazz=StringA.class;
            Field nameFile=clazz.getDeclaredField("aa");
            nameFile.setAccessible(true);
            nameFile.set(a,"zzz");
            Field[] fields = StringA.class.getDeclaredFields();
            for (Field f : fields) {
                String fileName = f.getName();
                int m = f.getModifiers();
                String mStr = Modifier.toString(m);
                System.out.println(fileName + " 属性:" + mStr);
            }

            System.out.println(a.getAa());
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        }
    }
}
